import { tags as tagsAsync } from '../../api/tags'

export const getTags = () => async (dispatch) => {
    dispatch(setLoading(true))
    try {
        const { tags } = await tagsAsync()
        dispatch(setTags(tags))
    } catch (error) {

    }
    dispatch(setLoading(false))
}

export const setTags = tags => ({
    type: 'setTags',
    tags
})

export const setLoading = loading => ({
    type: 'setLoading',
    loading
})